package com.rocky.project.service;

import java.io.Serializable;
import java.util.Collection;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.rocky.project.util.Page;
import com.rocky.project.util.Result;


public class BaseServiceImpl  extends HibernateDaoSupport implements BaseService {
	
	public BaseDao baseDao;

	public void clearCache() {
		baseDao.clearCache();		
	}

	public void create(Object entity) {
		baseDao.create(entity);		
	}

	public void delete(Object entity) {
		baseDao.delete(entity);		
	}

	public void deleteTrue(Object entity) {
		baseDao.deleteTrue(entity);		
	}

	public Result executeHqlNoParam(String querySql, Page page) {		
		return baseDao.executeHqlNoParam(querySql, page);
	}

	public Result executeHqlWithParam(String querySql, Object[] values, Page page) {		
		return baseDao.executeHqlWithParam(querySql, values, page);
	}

	public Object get(Class cls, Serializable id) {		
		return baseDao.get(cls, id);
	}

	public Collection loadAll(Class entityClass) {		
		return baseDao.loadAll(entityClass);
	}

	public void update(Object entity) {
		baseDao.update(entity);		
	}

	public BaseDao getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(BaseDao baseDao) {
		this.baseDao = baseDao;
	}

	public Collection executeHqlNoParam(String queryHql, int startAtIndex, Integer pageSize) {
		
		return baseDao.executeHqlNoParam(queryHql, startAtIndex, pageSize);
	}

	public Collection executeHqlWithParam(String queryHql, Object[] values, int startAtIndex, Integer pageSize) {
		
		return baseDao.executeHqlWithParam(queryHql, values, startAtIndex, pageSize);
	}

	public int getCountHqlNoParam(String querySql) {
		
		return baseDao.getCountHqlNoParam(querySql);
	}

	public int getCountHqlWithParam(String querySql, Object[] values) {
		
		return baseDao.getCountHqlWithParam(querySql, values);
	}

	public void evict(Object entity) {
		baseDao.evict(entity);
		
	}

	public void merge(Object entity) {
		baseDao.merge(entity);
		
	}








	
}
